// 
// Decompiled by Procyon v0.5.36
// 

package com.orange.boot.environment.controller;

import org.springframework.web.bind.annotation.GetMapping;
import com.orange.boot.environment.entity.EnvironmentData;
import java.util.List;
import com.orange.boot.utils.R;
import org.springframework.web.bind.annotation.PathVariable;
import com.orange.boot.environment.service.EnvironmentDataService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;

@Api("环境参数")
@RestController
@RequestMapping({"/environment"})
public class EnvironmentDataController {
    EnvironmentDataService service;

    public EnvironmentDataController(EnvironmentDataService service) {
        this.service = service;
    }

    @GetMapping({"/getDate/{code}"})
    public R getData(@PathVariable String code) {
        List<EnvironmentData> environmentData = this.service.getEnvironmentData(code);
        return environmentData.size() != 0 ? R.ok().data("data", environmentData) : R.error("获取数据失败");
    }
}
